# just install the right ones? This should enable cross compilation in the
# future anyway.
if [ -z "${windows}" ]; then
+ rm -rf rustc *.tar.gz
curl -O https://$host/dist/rust-nightly-i686-$target.tar.gz
curl -O https://$host/dist/rust-nightly-x86_64-$target.tar.gz
tar xfz rust-nightly-i686-$target.tar.gz
rm -f rust-nightly-i686-$target.tar.gz
rm -f rust-nightly-x86_64-$target.tar.gz
else
+ rm -rf rustc *.exe
if [ "${BITS}" = "64" ]; then
triple=x86_64-w64-mingw32
else
log!(5, "root={}; target={}; crate_types={}; verbose={}; req={}",
root.display(), target, crate_types, cx.primary, req);
- let primary = cx.primary;
let rustcs = try!(prepare_rustc(package, target, crate_types, cx, req));
Ok(rustcs.into_iter().map(|(rustc, kind)| {
let name = package.get_name().to_string();
let desc = rustc.to_string();
+ let is_path_source = package.get_package_id().get_source_id().is_path();
+ let show_warnings = cx.primary || is_path_source;
+ let rustc = if show_warnings {rustc} else {rustc.arg("-Awarnings")};
(proc() {
- if primary {
- log!(5, "executing primary");
- try!(rustc.exec().chain_error(|| {
- human(format!("Could not compile `{}`.", name))
- }))
- } else {
- log!(5, "executing deps");
- try!(rustc.exec_with_output().and(Ok(())).map_err(|err| {
- caused_human(format!("Could not compile `{}`.\n{}",
- name, err.output().unwrap()), err)
- }))
- }
+ try!(rustc.exec().chain_error(|| {
+ human(format!("Could not compile `{}`.", name))
+ }));
Ok(())
}, kind, desc)
}).collect())
assert_that(p.process(cargo_dir().join("cargo")).arg("fetch"),
execs().with_status(0).with_stdout(""));
})
+
+test!(warnings_in_git_dep {
+ let bar = git_repo("bar", |project| {
+ project.file("Cargo.toml", r#"
+ [package]
+ name = "bar"
+ version = "0.5.0"
+ authors = ["wycats@example.com"]
+ "#)
+ .file("src/lib.rs", "fn unused() {}")
+ }).assert();
+
+ let p = project("foo")
+ .file("Cargo.toml", format!(r#"
+ [project]
+ name = "foo"
+ version = "0.5.0"
+ authors = []
+ [dependencies.bar]
+ git = '{}'
+ "#, bar.url()).as_slice())
+ .file("src/main.rs", "fn main() {}");
+
+ assert_that(p.cargo_process("build"),
+ execs()
+ .with_stdout(format!("{} git repository `{}`\n\
+ {} bar v0.5.0 ({}#[..])\n\
+ {} foo v0.5.0 ({})\n",
+ UPDATING, bar.url(),
+ COMPILING, bar.url(),
+ COMPILING, p.url()))
+ .with_stderr(""));
+})